package io.renren.modules.aic.dao;

import io.renren.modules.aic.entity.TeamDto;
import io.renren.modules.aic.entity.TeamEntity;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;

/**
 * 推广团队表
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2018-03-29 22:21:59
 */
public interface TeamDao extends BaseMapper<TeamEntity> {

	/**
	 * 查询会员伞下对应等级会员
	 * 
	 * @param userLevel
	 * @return
	 */
	List<TeamDto> countTeamByUserLevel(Integer userLevel);

	/**
	 * 根据ID查询会员伞下对应等级会员
	 * 
	 * @param userLevel
	 * @param id
	 * @return
	 */
	Integer countTeamByHigherOne(@Param("userLevel") Integer userLevel, @Param("id") Long id);

	/**
	 * 根据level分组对应的Higher_
	 * 
	 * @param level
	 * @return
	 */
	List<Long> groupByHigher(@Param("level") Integer level);
}
